<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@page import="com.mdoffice.utils.DBConnection"%>
<html>
<body>
<%try
{
Connection con=DBConnection.getConnection();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from patient");
%>
<TABLE cellpadding="15" border="1" style="background-color: #ffffcc;">
<tr>
<th>ipapatientID</th>
<th>PatientName</th>
<th>PatientAddress</th>
<th>Diesease</th>
<th>Allocated Drugs</th>
<th><input type="Button" value = "Caption"> </th>
</tr>
<%
while (rs.next()) {
	%>
<TR>
<TD><a href="edit.jsp"><%=rs.getInt("patientID")%></a></TD>
<TD><%=rs.getString("pname")%></TD>
<TD><%=rs.getString("paddr")%></TD>
<TD><%=rs.getString("disease")%></TD>
<TD><%=rs.getString("drugs")%></TD>
</TR>
<% } %>
<%
// close all the connections.
rs.close();
st.close();
con.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%>
</TABLE>
<br>
<br>
<a href = "Home.jsp"> Home</a>
</body>
</html>